<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<title>搜索</title>
	<link type="text/css" href="css/reset.css" rel="stylesheet"/>
	<link type="text/css" rel="stylesheet" href="css/all.css" />
	<style>
		.select_head {
			width: 100%;
			height: 1rem;
			background: #ffffff;
			display: block;
			box-sizing: border-box;
			padding: 0.25rem 0.3rem 0 0.3rem;
			border-bottom: 1px solid #cccccc;
		}
		.back {
			width: 0.25rem;
			height: 0.4rem;
			float: left;
			margin-top: 0rem;
		}
		.select_d {
			width: 70%;
			height: 0.6rem;
			position: absolute;
			font-size: 0.14rem;
			top: 0.2rem;
			left: 15%;
			border: 1px solid #cccccc;
			border-radius: 0.45rem;
			-webkit-border-radius: 0.45rem;
			-moz-border-radius: 0.45rem;
			background: #e5e5e5;
		}
		.select_d_btn{
			font-size: 0.3rem;
		}
		.select_d_img {
			width: 0.45rem;
			height: 0.4rem;
			margin-top: 0.08rem;
			margin-left: 0.4rem;
			margin-right: 0.3rem;
			float: left;
		}
		.select_text {
			color: #ce0e0e;
			float: right;
			font-size: 0.3rem;
			line-height: 0.4rem;
		}
		.fjsj_detail{
			overflow: hidden;text-overflow: ellipsis; white-space: nowrap; margin:0.1rem auto;width: 100%; margin-right: 0.2rem;
		}
		.incase1_sc_li_con img{
			width: 1.5rem;
			height: 1.5rem;
		}
		.fjsj_r_1 p{
			font-size: 0.3rem;
		}
	</style>
</head>
<body style="background: #e5e5e5;">
<div class="select_head">
	<a href="javascript:history.go(-1)">
		<img src="img/img15.png" class="back">
	</a>
	<div class="select_d">
		<img src="img/img14.png" class="select_d_img">
		<input type="text" class="select_d_btn" id="select_d_btn" name="select_d_btn" placeholder="搜索店铺商品" />
	</div>
	<p class="select_text" style="z-index:1000;">搜索</p>
</div>
<div class="sc_tab">
	<ul class="sc_tab_con" id="incase1_sc">
		<!-- 商品列表 -->
	</ul>
</div>
</body>
<script src="../js/common.js"></script>
<script src="../js/rem.js"></script>
<script src="../js/jquery-2.2.3.min.js"></script>
<script>
    $('.select_text').click(()=>{
        console.log(SURL);
        var value = $('.select_d_btn').val();
        $.ajax({
            url: SURL + '/jfd/shopGoods/list',
            data:{
                goodsName:value
            },
            type: 'post',
            dataType: 'json',
            success: res => {
                res.list.length==0?alert('商品不存在'):
                    res.list.forEach(element=>{
                        $('#incase1_sc').append(
                            `
							<a href="../tmp/detail/shop-shangjia-detail.html?goodsType=3&id=${element.goodsId}">
								<li class="incase1_sc_li_con">
									<img src="${element.goodsImg}" class="incase1_sc_li_con_img">
									<div class="fjsj_r fr">
										<h1 style="white-space:nowrap; overflow:hidden; text-overflow: ellipsis; font-size:0.3rem;">名称：${element.goodsName}</h1>
										<div class="fjsj_r_1">
											<p class="fjsj_detail" style="">${element.goodsDetails}</p>
											<p style="margin:0.1rem auto;width: 100%; margin-right: 0.2rem;">库存：${element.goodsNum}</p>
											<p style="color:red; margin:0.1rem auto;width: 100%; margin-right: 0.2rem;">价格：<span style="color:red;">${element.shopPrice}</span></p>
										</div>
									</div>
								</li>
							</a>
							`
                        )
                    })
            }
        })
    })
</script>
</html>
